
%These are based on an earlier analysis

subjectList={'1',
'2',
'3',
'4',
'5',
'6',
'7',
%'8',
%'9',
'10',
'11',
%'12',
'13',
'14',
%'15',
'16',
'17',
%'18',
'19',
'20',
'21',
'22',
'23',
'24',
%'25',
'26',
'27',
'28',
'29',
'30',
'31',
%'32',
'33',
'34',
'35',
'36'}


for i = 1:length(subjectList)
	%clear whatever happened in the last loop, keep the subjectList and the variable i
	clearvars -except subjectList i
	
	%choose a subject from the list
	subject=char(subjectList(i));

	%load the ERP
	ERP = pop_loaderp( 'filename', [subject '.erp'], 'filepath', '/Users/jsprouse/Desktop/EEG class/clean ERPs/' );

	%change the baseline
	%ERP = pop_blcerp( ERP , 'Baseline', [300 500], 'Saveas', 'off' );
	


	%export the passive ERP
	pop_export2text( ERP, ['/Users/jsprouse/Desktop/exported ERPs/' subject '.txt'],  1:3, 'electrodes', 'on', 'precision',  4, 'time', 'on', 'timeunit',  0.001, 'transpose', 'on' );
	
end

